
package es.udc.emarketapp.emarket.model.user.dao;

import es.udc.emarketapp.emarket.model.user.vo.UserVO;
import es.udc.fbellas.j2ee.util.exceptions.InstanceNotFoundException;
import es.udc.fbellas.j2ee.util.exceptions.InternalErrorException;
import java.sql.Connection;

public interface SQLUserDAO {
       
    public boolean exists(Connection connection, String idUser)
    	throws InternalErrorException;
    
    public boolean exists(Connection connection, String idUser,
	    String pass) throws InternalErrorException;

     public boolean existsNifCif(Connection connection, String nifCif)
             throws InternalErrorException;
    
    public UserVO findById(Connection connection, String idUser)
    	throws InternalErrorException, InstanceNotFoundException;
    
    public UserVO findById(Connection connection, String idUser,
	    String pass) throws InternalErrorException,
            InstanceNotFoundException;

    public void update(Connection connection, UserVO userVO)
            throws InternalErrorException, InstanceNotFoundException;
    
    public void updateEMail(Connection connection, String idUser, String email)
    	throws InternalErrorException;
    
    public void updatePassword(Connection connection, String idUser,
	    String pass) throws InternalErrorException;
    
    public void updateAddress(Connection connection, String idUser,
	    String dir, String ciudad, String cp, String prov)
            throws InternalErrorException;
    
    public void updatePais(Connection connection, String idUser,
	    String pais) throws InternalErrorException;
    
    public void updateTel1(Connection connection, String idUser,
	    String tel1) throws InternalErrorException;
    
    public void updateTel2(Connection connection, String idUser,
	    String tel2) throws InternalErrorException;

    public boolean isValid(Connection connection, String idUser)
		throws InstanceNotFoundException, InternalErrorException;

    public void invalidate(Connection connection, String idUser)
		throws InstanceNotFoundException, InternalErrorException;

    public void remove(Connection connection, String idUser)
    	throws InstanceNotFoundException, InternalErrorException;

}
